package com.yunxi.service.localService.impl.sat;

import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.dao.sat.SatTestDriveMapper;
import com.yunxi.hubToBiz.pojo.CustomerTestDriveVO;
import com.yunxi.model.sat.SatCustomerClue;
import com.yunxi.model.sat.SatTestDrive;
import com.yunxi.sat.pojo.SatTestDriveCompletelVO;
import com.yunxi.sat.pojo.SatTestDriveDetailVO;
import com.yunxi.sat.pojo.SatTestDriveVO;
import com.yunxi.service.localService.sat.SatTestDriveService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * <p>
 * 试乘试驾表 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-07-31
 */
@Service
public class SatTestDriveServiceImpl extends ServiceImplPlus<SatTestDriveMapper, SatTestDrive> implements SatTestDriveService {

    @Override
    public Integer checkPlanTestDriveTime(SatTestDriveVO satTestDriveVO) {
        return baseMapper.checkPlanTestDriveTime(satTestDriveVO);
    }

    @Override
    public SatTestDriveDetailVO getInfoById(String driveId) throws Exception {
        return baseMapper.getInfoById(driveId);
    }

    @Override
    public SatTestDriveDetailVO testDriveInfo(String customerNo) throws Exception {
        return baseMapper.testDriveInfo(customerNo);
    }

    /**
     * 查询超过计划试驾时间15分钟的单据
     * @return
     * @throws Exception
     */
    @Override
    public List<SatTestDriveVO> getLateTestDrive() throws Exception {
        return baseMapper.getLateTestDrive();
    }

    /**
     * 查询本月全部新增试驾
     * @param satTestDriveCompletelVO
     * @return
     * @throws Exception
     */
    @Override
    public List<SatTestDriveDetailVO> allList(SatTestDriveCompletelVO satTestDriveCompletelVO) throws Exception {
        return baseMapper.allList(satTestDriveCompletelVO);
    }

    @Override
    public List<String> getCustomerSales(CustomerTestDriveVO customerTestDriveVO) throws Exception {
        return baseMapper.getCustomerSales(customerTestDriveVO);
    }

    /**
     * 查询用户姓名电话
     * @param userCode
     * @return
     */
    @Override
    public SatTestDriveVO getSalesInfo(String userCode) {
        return baseMapper.getSalesInfo(userCode);
    }

    /**
     * 查询未分配销售顾问,渠道的试驾信息
     * @param satCustomerClue
     * @return
     * @throws Exception
     */
    @Override
    public List<SatTestDrive> queryEmptyTestDrive(SatCustomerClue satCustomerClue) throws Exception {
        return baseMapper.queryEmptyTestDrive(satCustomerClue);
    }
}
